package scjp.preparation.stringprocessing;

public class FormatingTest {

	static void line() {
		System.out
				.println("-----------------------------------------------------------------");
	}

	static void printHeader() {
		System.out.printf("%-15s \t %s \t %s \t %s \n", "Player", "Matches",
				"Goals", "Goals per match");
	}

	static void printRow(String player, int matches, int goals) {
		System.out.printf("%-15s \t %5d \t\t %d \t\t %.2f \n", player, matches,
				goals, ((float) goals / (float) matches));
	}

	public static void main(String[] args) {
		
		FormatingTest.line();
		FormatingTest.printHeader();
		FormatingTest.line();
		FormatingTest.printRow("Demando", 100, 122);
		FormatingTest.printRow("Mushi", 80, 100);
		FormatingTest.printRow("Peale", 150, 180);
		FormatingTest.line();

	}

}
